# encoding=utf-8
import jieba

seg_list = jieba.cut("我来到北京清华大学", cut_all=True)
print("Full Mode: " + "/ ".join(seg_list))

seg_list = jieba.cut("A survey of user opinion of computer system response time", cut_all=False)
print("Default Mode: " + "/ ".join(seg_list))

seg_list = jieba.cut("他来到了网易杭研大厦")
print(", ".join(seg_list))

seg_list = jieba.cut_for_search("小明硕士毕业于中国科学院计算所，后在日本京都大学深造")  # 搜索引擎模式
print(", ".join(seg_list))



# print os.getcwd()
# os.chdir('D:\\Code\\SogouC.reduced.20061102\\Reduced')
# try:
#     with codecs.open("C000008\\10.txt", 'r', 'gbk') as handle:
#          for ln in handle:
#              print(ln)
#              seg_list = jieba.cut(ln, cut_all=False)
#              print("Default Mode: " + "/ ".join(seg_list))
# except IOError:
#     print "The file don't exist, Please double check!"
#     exit()
# print 'The file mode is ',handle.mode
# print 'The file name is ',handle.name
# P = handle.tell()
# print 'the postion is %d' %(P)
# handle.close()
